﻿
namespace Service
{
    using Data.Repository;
	using System.Collections.Generic;

    public class ProductReviewHelpfulnessService : IProductReviewHelpfulnessService
    {
        private IProductReviewHelpfulnessRepository _productReviewHelpfulnessRepository;

        #region IProductReviewHelpfulnessService Members

        /// <summary>
        /// create new ProductReviewHelpfulness
        /// </summary>
        /// <param name="theNewProductReviewHelpfulness">the new ProductReviewHelpfulness instance</param>
        /// <returns>the new ProductReviewHelpfulness's ID</returns>
        public int CreateNewProductReviewHelpfulness(Data.Entity.ProductReviewHelpfulness theNewProductReviewHelpfulness)
        {
            if (theNewProductReviewHelpfulness == null)
            {
                return 0;
            }

            if (_productReviewHelpfulnessRepository == null)
            {
                _productReviewHelpfulnessRepository = new ProductReviewHelpfulnessRepository();
            }

            return _productReviewHelpfulnessRepository.CreateNewProductReviewHelpfulness(theNewProductReviewHelpfulness);
        }

        #endregion
    }
}
